//
//  SHCenterViewController.m
//  SHDrawerController
//
//  Created by UUPlant on 2022/4/8.
//

#import "SHCenterViewController.h"
#import "UIViewController+SHDrawerController.h"

@interface SHCenterViewController ()

@end

@implementation SHCenterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self configNavigationItem];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    NSLog(@"centerViewController viewWillAppear");
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    NSLog(@"centerViewController viewWillDisappear");
}

- (void)configNavigationItem{
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Left" style:UIBarButtonItemStylePlain target:self action:@selector(leftButtonClick:)];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Right" style:UIBarButtonItemStylePlain target:self action:@selector(rightButtonClick:)];
}

- (void)leftButtonClick:(UIBarButtonItem *)sender {
    [self.sh_drawerViewController toggleDrawerSide:SHDrawerSideStateLeft animated:YES completion:nil];
}

- (void)rightButtonClick:(UIBarButtonItem *)sender {
    [self.sh_drawerViewController toggleDrawerSide:SHDrawerSideStateRight animated:YES completion:nil];

}
@end
